/**
 * Created by wxl on 2016/12/16.
 */
import {
    DETAIL_DATA_SUCCESS,
    DETAIL_HOT_DATA_SUCCESS,
    DETAIL_PLIST_DATA_SUCCESS
} from '../actions/types'
import { createReducer } from 'redux-immutablejs'
import {fromJS} from 'immutable'

const initialState = fromJS({
    data:[],
    hotData:[],
   pListData:[]
})

export const article= createReducer(initialState,{
    [DETAIL_DATA_SUCCESS]: (state,action)=> {
        return state.merge({
            data: action.req.data.info
        })
    },
    [DETAIL_HOT_DATA_SUCCESS]:(state,action)=>{
         return state.merge({
             hotData:action.req.data.info
         })
    },
    [DETAIL_PLIST_DATA_SUCCESS]:(state,action)=>{
        return state.merge({
            pListData:action.req.data.info
        })
    }
})

